package testdemo;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 黎鹤舞
 * Date: 2023-11-28
 * Time: 21:18
 */
public class Solution {
    public void merge(int A[], int m, int B[], int n) {
        //A数组的空间一定能容纳A和B的大小
        //从大测排序
        int i = m - 1;
        int j = n - 1;
        while(i > 0 && j > 0) {
            if(A[i] > B[j]) {
                A[i+n] = A[i];
                A[i] = B[j];
                i--;
                j--;
            }else {
                A[i + 1] = B[j];
                i--;
                j--;
            }
        }


    }
}